package com.mapper;

import com.pojo.PingJia_db;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PingJiaMapper_db {
    List<PingJia_db> list(@Param("stime") String stime,@Param("etime") String etime,@Param("id") Integer id);

    @Select("select * from pingjia_db")
    List<PingJia_db> listAll();

    @Select("select * from pingjia_db where p_kid = #{id}")
    List<PingJia_db> listById(Integer id);

    @Insert("insert into pingjia_db(p_name,p_level,p_text,p_time,p_kid) values (#{pName},#{pLevel},#{pText},#{pTime},#{pKid})")
    Integer add(PingJia_db pingJiaDb);

    @Update("update pingjia_db set p_name = #{pName},p_level = #{pLevel},p_text = #{pText},p_time = #{pTime},p_kid = #{pKid} where p_id = #{pId}")
    Integer update(PingJia_db pingJiaDb);

    @Delete("delete from pingjia_db where p_id = #{pId}")
    Integer del(Integer pId);
}
